import React from "react";

const SelectListGroup = ({ name, options, value, type, info, onChange }) => {
  const selectOptions = options.map(option => (
    <option key={option.label} value={option.value}>
      {option.value}
    </option>
  ));
  return (
    <div className="form-group">
      <select
        className="form-control form-control-lg"
        name={name}
        value={value}
        onChange={onChange}
        info={info}
      >
        {selectOptions}
      </select>
      {info && <small className="form-text text-muted">{info}</small>}
    </div>
  );
};

export default SelectListGroup;
